import React, { Component } from 'react';
import {index_nav} from '../utils/api'

class MyEntry extends Component {
    constructor(props){
        super(props)
        this.state = {
            catelist: [{}]
        }
        index_nav().then((res)=>{
            this.setState({
                catelist:res.data.list
            })
        })
    }
    render() {
        return (
            <div className='myentry'>
                {
                    this.state.catelist&&this.state.catelist.map((item, index) => {
                        return (
                            <div className='mycate' key={index}>
                                <img src={item.pic} alt="" />
                                <div className='name'>{item.name}</div>
                            </div>
                        )
                    })
                }
            </div>
        );
    }
}

export default MyEntry;